package factory.abstr;

import factory.Computer;
import factory.func.AsusFactory;
import factory.func.Factory;
import factory.func.LenvoFactory;
import factory.func.MacBookFactroy;

/**
 * Created by liuweijie on 2018/4/24.
 */
public abstract class AbstaceFactory {

    public abstract Computer getComputer();

    public Computer getComputer(String name){
        switch (name){
            case "Lenvo":return new LenvoFactory().getComputer();
            case "Asus":return new AsusFactory().getComputer();
            case "MacBook":return new MacBookFactroy().getComputer();
            default:
                System.out.println("生产不出来");
                return null;
        }
    }
}
